﻿@model Models.DataModel.UserAccount
@{
    ViewBag.Title = "Edituser";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Edit @Model.UserName</h2>
@using (Html.BeginForm("Edituser", "UserAccount", FormMethod.Post, new { @class = "form-horizontal", role = "form", name = "dataupload", id = "dataupload", onsubmit = "return CheckInput();" }))
{
    @Html.ValidationSummary();
    @Html.HiddenFor(c => c.UserAccountID)
    @Html.HiddenFor(c => c.CreatedOn)
    @Html.HiddenFor(c => c.CreatedBy)
    @Html.HiddenFor( c => c.Password)
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("UserName")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.UserName, new { @readonly = true })</div><br />
    </div><br />
    @*<div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Password")</div>
        <div class="col-xs-6 col-md-4">@Html.PasswordFor(c => c.Password)<em class="error" id="pass" style="display:none;">Please input your password</em></div><br />
        <br />
    </div><br />*@
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("First Name")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.FirstName)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Last Name")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.LastName)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Full Name")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.FullName)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Birthday")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.Birthday)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Email")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.Email)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Decription")</div>
        <div class="col-xs-6 col-md-4">@Html.TextBoxFor(c => c.Description)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("GroupUserId")</div>
        <div class="col-xs-6 col-md-4">@Html.DropDownListFor(c => c.GroupUserID, ViewBag.lstGroupUser as SelectList)</div><br />
    </div><br />
    <div class="">
        <div class="col-xs-12 col-sm-6 col-md-2">@Html.Label("Active")</div>
        <div class="col-xs-6 col-md-4">@Html.CheckBox("Activevalue")</div><br />
    </div><br />
    <input type="submit" value="Save" class="btn btn-primary" style="margin-left:200px" />
}
<script>
    function CheckInput() {
        var _kq = 1;
        if (document.dataupload.Password.value == "") {
            $("#pass").attr("style", "display:block");
            document.dataupload.Password.focus();
            _kq = 0;
            return false;
        }
        else {
            $("#pass").attr("style", "display:none");
        }
    }
</script>